package com.example.consumer;

import java.math.BigInteger;
import java.util.concurrent.ConcurrentHashMap;

public class TesMain {
    static final int HASH_BITS = 0x7fffffff;
    public static void main(String[] args) {
        BigInteger bigInteger = new BigInteger("8800ac5abf60a10a",16);
        System.out.println(bigInteger.toString(10));

        String string = "8818ag5abf60a10a";//148324954
        System.out.println(string.hashCode());
        int hash = string.hashCode();
        int hash1=(hash ^ (hash >>> 16)) & 0x7fffffff;
        //hash=hash & HASH_BITS;//148359821
        System.out.println(getSpanId("8800ac5aqf60a10a"));

    }

    private static int getSpanId(String spanId){
        final int HASH_BITS = 0x7fffffff;
        if (spanId!=null && !"".equals(spanId)) {
            int h = spanId.hashCode();
            return (h ^ (h >>> 16)) & HASH_BITS;
        }else {
            return 1;
        }
    }
}
